const express = require("express")

const app = express()

const qs = require("querystring")

app.use((req, res, next) => {
    let str = ""
    req.on('data', (chunk) => {
        str += chunk
    })
    req.on('end', () => {
        const body = qs.parse(str)
        req.body = body
        // console.log(body)
        next()
    })
})

app.post('/user', (req, res) => {
    console.log(req.body)
    res.send("send")
})

app.listen(8080, () => {
    console.log("服务器已经启动")
})